#ifndef _XMLOBJECT_H_
#define _XMLOBJECT_H_

#ifdef _DEBUG
#pragma comment ( lib, "tinyxmlD.lib" )
#else
#pragma comment ( lib, "tinyxml.lib" )
#endif

#include <utillib/script/tinyxml.h>
#include <utillib/script/tinystr.h>
#include <utillib/string/string.h>

#include <deque>

namespace utillib
{
	namespace script
	{
		class XMLObject
		{
		public:
			XMLObject();
			virtual ~XMLObject();

			bool load( char *filename );

			bool getNext( char *name = NULL );
			TiXmlNode *getChild();
			bool isExistChild();

			bool getNextValue();

			TiXmlNode *getNode();
			bool setNode( TiXmlNode *node , bool settingElement = true );

			const char *getTitle();
			const char *getName();
			const char *getValue();
			const char *getText();

			int getIntValue();

			bool firstChild( char *name );
		private:
			void toElement();

			TiXmlDocument m_xmlDocument;
			TiXmlNode *m_xmlNode;
			TiXmlElement *m_xmlElement;
			TiXmlAttribute *m_xmlAttribute;
			
		};
	};
};

#endif